package de.tum.in.eist.poll.client.widgets.menu;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

import de.tum.in.eist.poll.client.widgets.other.LogoutButton;

/**
 * The student menu side bar
 * @author aperture
 *
 */
public class StudentMenu extends Composite implements Menu {
	public StudentMenu() {

	}

	private Widget initialization() {
		VerticalPanel result = new VerticalPanel();

		result.add(new HTML("<h2>Main Menu</h2>"));
		
		Grid menuGrid = new Grid(4, 2);

		menuGrid.setWidget(0, 0, new Image("./images/arrow.jpg"));
		menuGrid.setWidget(0, 1, new Hyperlink("Home", "main"));

		menuGrid.setWidget(1, 0, new Image("./images/asterisk.jpg"));
		menuGrid.setWidget(1, 1, new Hyperlink("Submit opinion",
				"LectureOverview"));

		menuGrid.setWidget(3, 1, new LogoutButton());

		result.add(menuGrid);
		return result;
	}

	@Override
	public Widget draw() {
		initWidget(initialization());
		return this;
	}
}
